<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Pour faire l'appel'</title>
</head>
<body bgcolor="lightgreen">

 
<BODY>
    
<?php


function  insertion($nom,$prenom,$date,$heure,$nom_image)
{
	$query =mysql_query("INSERT INTO click VALUES('', '$nom', '$prenom', '$date', '$heure', '$nom_image')");

mysql_query($query);
}



$user ='root';

$bdd ='BDD_Historique_Click';


$host ='localhost';


$passwd  ='';


mysql_connect($host, $user,$passwd) or die("erreur de connexion au serveur");

mysql_select_db($bdd) or die("erreur de connexion a la base de donnees");



$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
$date=date("d-m-Y");
$heure=date("H:i");




	$xml = simplexml_load_file("https://picasaweb.google.com/data/feed/base/user/113848708930851956597/albumid/5795380358275112865?alt=rss&kind=photo&hl=fr");
	foreach ($xml->channel->item as $item){
		echo "<img src='".$item->enclosure['url']."' onclick='".insertion($nom,$prenom,$date,$heure,$item->title)."' />";
		echo "<div>".$item->title."</div>";
		
	}




// Recuperation des resultats
//while($result1=mysql_fetch_array( $result )or die(mysql_error()) )
//{
//echo( "<tr>\n" );
//echo( "<td><div align=\"center\">".$result1["titre"]."</div></td>\n" );
//echo( "<td><div align=\"center\">".$result1["extension"]."</div></td>\n" );

//echo( "</tr>\n" );
//}
 
//echo( "</table><br>\n" );

// Deconnexion de la base de donnees
mysql_close();
// Connexion au serveur


?>

</body>
</html>